// pages/message/mContent/mContent.js
Page({

  
  data: {
    motto: '知乎--微信小程序版',
    userInfo: {},
    zanNum01:34,     //评论的点赞数
    zanNum:22,
    flag:1,        //评论按钮的状态 1：点赞前   0：点赞后

    color:1,      //底部栏点赞按钮状态
    goodNum:2100 ,  //底部栏点赞数

    heart:1,       //底部栏喜欢按钮状态
    heartNum:1234,  

    star:1,        //收藏按钮
    starNum:2415,

    flag01:1,   //举报按钮

    comment:1,   //评论
    commentNum:302,
  },

  onLoad:function(options){
    var cb = JSON.parse(options.cb);
    this.setData({
      cb:cb
    })
  },

  //评论点赞
  reply:function(){
    if(this.data.flag){
      this.setData({
        flag:0,
        zanNum01:Number(this.data.zanNum01+1)
      })
    }else{
      this.setData({
        flag:1,
        zanNum01:Number(this.data.zanNum01-1)
      })
    }
    
  },

  //底部栏点赞
  goodNumChange:function(){
    if(this.data.color){
      this.setData({
        color:0,
        goodNum:Number(this.data.goodNum+1)
      })
    }else{
      this.setData({
        color:1,
        goodNum:Number(this.data.goodNum-1)
      })
    }
    
  },

  //底部栏喜欢按钮
  heartNumChange:function(){
    if(this.data.heart){
      this.setData({
        heart:0,
        heartNum:Number(this.data.heartNum+1)
      })
    }else{
      this.setData({
        heart:1,
        heartNum:Number(this.data.heartNum-1)
      })
    }
  },

  //底部栏收藏按钮
  starNumChange:function(){
    if(this.data.star){
      this.setData({
        star:0,
        starNum:Number(this.data.starNum+1)
      })
    }else{
      this.setData({
        star:1,
        starNum:Number(this.data.starNum-1)
      })
    }
  },

  //举报
  dislikeNumChange:function(){
    if(this.data.flag01){
      this.setData({
        flag01:0,
        // starNum:Number(this.data.starNum+1)
      })
    }else{
      this.setData({
        flag01:1,
        // starNum:Number(this.data.starNum-1)
      })
    }
  },

  //点击评论图标弹出评论框
  discussAction:function(e){
    // console.log('点击评论')
    // wx.showToast({
    //   title: '评论成功',
    //   icon:'none'
    // })
    this.setData({
      discussShow:true
    })
  },

  //点击发送按钮收起评论框
  send:function(){
    this.setData({
      discussShow:false,
      comment:0,
      commentNum:Number(this.data.commentNum+1)
    })
  },

})